package com.achievementmanagement.management.frame;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.WindowConstants;

import com.achievementmanagement.management.frame.listeners.LoginListener;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class Login extends javax.swing.JFrame {

	{
		//Set Look & Feel
		try {
			javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
		} catch(Exception e) {
			e.printStackTrace();
		}
	}

	private static final long serialVersionUID = 1949235691894011240L;
	private JLabel lblIcon;
	private JTextField txtUsername;
	private JButton btnExit;
	private JButton btnLogin;
	private JPasswordField txtPassword;
	private JLabel lblPassword;
	private JLabel lblUsername;
	private LoginListener listen;

	public Login() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
			this.setTitle("\u91cd\u5e86\u5e02\u6c5f\u6d25\u533a\u56db\u724c\u574a\u5c0f\u5b66\u6821\u671f\u672b\u8003\u8bd5\u6210\u7ee9\u7ba1\u7406\u7cfb\u7edf_\u7ba1\u7406\u7aef");
			getContentPane().setLayout(null);
			this.setResizable(false);
			{
				lblIcon = new JLabel();
				getContentPane().add(lblIcon);
				lblIcon.setIcon(new ImageIcon(getClass().getClassLoader().getResource("res/login.jpg")));
				lblIcon.setBounds(40, 46, 135, 135);
			}
			{
				lblUsername = new JLabel("\u7528\u6237\u540d\uff1a",SwingConstants.RIGHT);
				getContentPane().add(lblUsername);
				lblUsername.setText("\u7528\u6237\u540d\uff1a");
				lblUsername.setBounds(271, 55, 48, 15);
			}
			{
				lblPassword = new JLabel("\u5bc6\u7801\uff1a",SwingConstants.RIGHT);
				getContentPane().add(lblPassword);
				lblPassword.setText("\u5bc6\u7801\uff1a");
				lblPassword.setBounds(271, 92, 36, 15);
				lblPassword.setHorizontalAlignment(SwingConstants.RIGHT);
			}
			{
				txtUsername = new JTextField();
				getContentPane().add(txtUsername);
				txtUsername.setBounds(334, 52, 146, 21);
			}
			{
				txtPassword = new JPasswordField();
				getContentPane().add(txtPassword);
				txtPassword.setBounds(334, 89, 146, 21);
			}
			{
				btnLogin = new JButton();
				getContentPane().add(btnLogin);
				btnLogin.setText("\u767b\u5f55");
				btnLogin.addActionListener(listen);
				btnLogin.setBounds(271, 140, 82, 46);
			}
			{
				btnExit = new JButton();
				getContentPane().add(btnExit);
				btnExit.addActionListener(listen);
				btnExit.setText("\u9000\u51fa");
				btnExit.setBounds(398, 140, 82, 46);
			}
			pack();
			this.setBounds(100,100,528, 275);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

}
